grant-table: simplify get_paged_frame
authorJulien Grall <julien.grall@arm.com>
Thu, 21 Sep 2017 13:33:04 +0000 (15:33 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 21 Sep 2017 13:33:04 +0000 (15:33 +0200)
commitb532dfff95dd775907528737f77472a227c9536a
tree1c6221c8573d35b483944283cc2d17a538ac1d83
parent00cc5cd669122b77b336dae52566e813ec45122d
grant-table: simplify get_paged_frame

The implementation of get_paged_frame is currently different whether the
architecture support sharing memory or paging memory. Both
version are extremely similar so it is possible to consolidate in a
single implementation.

The main difference is the x86 version will allow grant on foreign page
when using HVM/PVH whilst Arm does not. At the moment, on x86 foreign pages
are only allowed for PVH Dom0. It seems that foreign pages should never
be granted so deny them

The check for shared/paged memory are now gated with the respective ifdef.
Potentially, dummy p2m_is_shared/p2m_is_paging could be implemented for
Arm.

Lastly remove pointless parenthesis in the code modified.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
xen/common/grant_table.c